php remove specific element from array

44

if (($key = array_search('strawberry', $array)) !== false) {
    unset($array[$key]);
}
if (($key = array_search('strawberry', $array)) !== false) {
    unset($array[$key]);
}

Comments

Submit
0 Comments